 <%@ page contentType="text/html; charset=UTF-8"%>
 <%@ taglib prefix="s" uri="/struts-tags"%>
 <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
 <html>
    <head>
       <link href="
       <s:url value="resources/css/main.css"/>
       " rel="stylesheet" type="text/css"/>
    </head>
    <body>
       <center>
            <table width=600 align=center>
                        <tr>
                            <td>Customer CRUD </td>
                        </tr>
                     </table>

          <table>
             <tr>
                <td align="left" style="font:bold;color:red">
                   <s:fielderror/>
                   <s:actionerror/>
                   <s:actionmessage/>
                </td>
             </tr>
          </table>
          <s:form>
             <table align="center" class="borderAll">
                <s:hidden name="customer.id" />
                <s:hidden name="criteria" value="A0"/>
                <s:hidden name="criteriaSubId" value="1"/>

                <tr>
                   <td class="tdLabel">
                      <s:text name="label.customer.firstName"/>
                   </td>
                   <td>
                      <s:textfield name="customer.firstName" size="30"/>
                   </td>
                </tr>
                <tr>
                   <td class="tdLabel">
                      <s:text name="label.customer.lastName"/>
                   </td>
                   <td>
                      <s:textfield name="customer.lastName" size="30"/>
                   </td>
                </tr>
                <tr>
                   <td class="tdLabel">
                      <s:text name="label.customer.registrationDate"/>
                   </td>
                   <td>
                       <s:textfield name="customer.registrationDate" size="10" />
                   </td>
                </tr>
                <tr>
                   <td class="tdLabel">
                      <s:text name="label.customer.contactInfo"/>
                   </td>
                   <td>
                      <s:select name="customer.contactInfo.contactInfoId"
                         list="#session.contactInfoList"
                         listKey="contactInfoId"
                         listValue="contactInfoId"
                         multiple="false"
                         />
                   </td>
                </tr>
                <tr>
                   <td class="tdLabel">
                      <s:text name="label.customer.customerCode"/>
                   </td>
                   <td>
                      <s:textfield name="customer.customerCode" size="10" />
                   </td>
                </tr>
                <tr>
                   <td class="tdLabel">
                      <s:text name="label.customer.creditLimit"/>
                   </td>
                   <td>
                      <s:textfield name="customer.creditLimit" size="10" />
                   </td>
                </tr>
             </table>
             <br/>
             <table>
                <tr>
                   <td>
                    <s:if test="customer==null || customer.id == null">
                                            <s:submit action="customerCRUD" key="button.label.submit" cssClass="butStnd"/>
                                         </s:if>
                                         <s:else>
                      <s:submit action="customerUpdate" key="button.label.submit" cssClass="butStnd"/>
                                         </s:else>


                   </td>
                   <td>
                      <s:reset key="button.label.cancel" cssClass="butStnd" action="customerInsertOrUpdate" />
                   </td>
                <tr>
             </table>
          </s:form>
       </center>
    </body>
 </html>